﻿@model Seven.DataModel.ViewModels.AccountAbout.PasswordModel

<form id="ResetPassWord-Form" name="ResetPassWord-Form">
    <div class="div_center">
        <fieldset>
            <legend class="panel-title">用户信息</legend>
            @Html.HiddenFor(m => m.UserID)
            <table class="TableBlock">
                <tr>
                    <td class="TableLabel">
                        姓名：
                    </td>
                    <td class="TableData">
                        @Model.RealName
                    </td>
                    <td class="TableLabel">
                        用户名：
                    </td>
                    <td class="TableData">
                        @Model.UserName
                    </td>
                </tr>
                <tr>
                    <td class="TableLabel">
                        新密码：
                    </td>
                    <td class="TableData">
                        @Html.PasswordFor(m => m.NewPassWord)
                    </td>
                    <td class="TableLabel">
                        新密码确认：
                    </td>
                    <td class="TableData">
                        @Html.PasswordFor(m => m.ConfirmPassWord)
                    </td>
                </tr>
            </table>
        </fieldset>
    </div>
</form>

<script>
    $(function () {
        var _form = $("#ResetPassWord-Form");
        var _key = $("#ID", _form);
        var _bindControl = function () {

            //定义验证规则
            $("#UserName", _form).attr("readonly", "readonly").addClass("BigStatic");

            $("#NewPassWord,#ConfirmPassWord", _form).validatebox({
                required: true,
                validType: ['maxLength[16]', 'passwordNew']
            });

            $("#ConfirmPassWord", _form).validatebox({
                required: true,
                validType: ["equals['NewPassWord','id']"]
            });

        };

        _bindControl();
    });
</script>
